const {ipcMain} = require('electron');

/**
 * @author Chauncey
 */
class SystemIpc {

    /**
     * ipc监听
     */
    static ipcAll(mainWindow) {
        this.close(mainWindow);
        this.minimize(mainWindow);
    }

    /**
     * 关闭
     * @param mainWindow
     */
    static close(mainWindow) {
        ipcMain.on('close', event => {
            mainWindow.close();
        });
    }

    /**
     * 最小化
     * @param mainWindow
     */
    static minimize(mainWindow) {
        ipcMain.on('minimize', event => {
            mainWindow.minimize();
        });
    }



}

module.exports = SystemIpc
